package com.dundun.SSO.manage.impl;

import com.dundun.SSO.core.impl.BaseServiceImpl;
import com.dundun.SSO.manage.ISsoUserGroupRelationService;
import com.dundun.SSO.manage.dao.SsoUserGroupRelationDao;
import com.dundun.SSO.manage.pojo.SsoUser;
import com.dundun.SSO.manage.pojo.SsoUserGroupRelation;
import com.dundun.SSO.manage.query.SsoUserGroupRelationQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**********************************************************
 * 版权所有：搜影科技 保留所有权利
 * 创建日期: 2017/5/10 0010 15:01
 * 创建作者: gezhangkai
 * 版    本:
 * 功    能:
 * 最后修改时间:
 * 修改记录:
 ***********************************************************/
@Service
public class SsoUserGroupRelationServiceImpl extends BaseServiceImpl<SsoUserGroupRelation> implements ISsoUserGroupRelationService{

    @Autowired
    private SsoUserGroupRelationDao ssoUserGroupRelationDao;


    public List<SsoUserGroupRelation> selectByPage(SsoUserGroupRelationQuery ssoUserGroupRelationQuery) {
        return ssoUserGroupRelationDao.selectByPage(ssoUserGroupRelationQuery);
    }

    public Integer selectCountByPage(SsoUserGroupRelationQuery ssoUserGroupRelationQuery) {
        return ssoUserGroupRelationDao.selectCountByPage(ssoUserGroupRelationQuery);
    }

    public List<SsoUserGroupRelation> selectAllUserGroupRelationByUserId(Long userId) {
        Example example = new Example(SsoUserGroupRelation.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("userId",userId);
        List<SsoUserGroupRelation> ssoUserGroupRelationList = selectByExample(example);
        return ssoUserGroupRelationList;
    }

}
